package com.fast.modules.websocket.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.simp.SimpMessagingTemplate;
import org.springframework.stereotype.Service;

@Service
public class WebSocketService {

    @Autowired
    private SimpMessagingTemplate simpMessagingTemplate;

    public void sentMsg(String user, String destination, Object response) {
        simpMessagingTemplate.convertAndSend(destination + "/" + user, response);
    }
    
    
    public void sentMsgForUser(String user, String destination, Object response) {
        simpMessagingTemplate.convertAndSendToUser(user, destination, response);
    }


}
